#import <Foundation/Foundation.h>

int main(int argc, char *argv[]) {
	if (argc<1) return 0;
    int len;
	int i;
	 
	for (i=1; i<argc;i++){
		len += strlen(argv[i]);
	}
    char *cmd = malloc(len+1);
    strcpy(cmd, argv[1]);
	for (i=2; i<argc;i++){
        strcat(cmd, " ");
		strcat(cmd,argv[i]);
	}
    FILE *pipe = popen(cmd, "r");
    if (!pipe) return -1;
    char buf[1024];
    while(fgets(buf, 1024, pipe)) {
		printf(buf);
    }
    pclose(pipe);
    free (cmd);
	return 0;
}


